home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 February / macformat-034.iso / mac / Shareware City / Applications / Laughing Bird Folder / The Laughing Bird Restaurant / The Laughing Bird Restaurant.dxr / 00357_MovieScript2.ls < prev    next >
Encoding:
Text File  |  1995-12-16  |  4.4 KB  |  158 lines

  1. on wait ticks
  2.   set startDelay to the timer
  3.   repeat while the timer < (startDelay + ticks)
  4.   end repeat
  5. end
  6.  
  7. on initPush start, stop, TRUEorFALSE
  8.   global gpushCurs
  9.   repeat with n = start to stop
  10.     puppetSprite(n, TRUEorFALSE)
  11.     set the cursor of sprite n to gpushCurs
  12.   end repeat
  13. end
  14.  
  15. on init start, stop, TRUEorFALSE
  16.   repeat with n = start to stop
  17.     puppetSprite(n, TRUEorFALSE)
  18.   end repeat
  19. end
  20.  
  21. on button handlerName
  22.   set whichsprite to the clickOn
  23.   set actNow to 0
  24.   set castUp to the castNum of sprite whichsprite
  25.   set castDown to castUp + 1
  26.   set clicker to 1
  27.   repeat while the stillDown
  28.     if rollOver(whichsprite) then
  29.       if clicker = 1 then
  30.         puppetSound("Bink", 1)
  31.         set clicker to 0
  32.       else
  33.         nothing()
  34.       end if
  35.       set the castNum of sprite whichsprite to castDown
  36.       updateStage()
  37.       set actNow to 1
  38.       next repeat
  39.     end if
  40.     set the castNum of sprite whichsprite to castUp
  41.     updateStage()
  42.     set actNow to 0
  43.     if clicker = 0 then
  44.       set clicker to 1
  45.     end if
  46.   end repeat
  47.   if the castNum of sprite whichsprite = castDown then
  48.     set the castNum of sprite whichsprite to castUp
  49.     updateStage()
  50.   end if
  51.   if actNow = 1 then
  52.     do(handlerName)
  53.   end if
  54. end
  55.  
  56. on QuitNow
  57.   init(1, 40, 0)
  58.   if the text of field "PersonalMenu" = "EMPTY" then
  59.     go("quit")
  60.   else
  61.     go("quitNsave")
  62.   end if
  63. end
  64.  
  65. on PrintField
  66.   if the machineType = 256 then
  67.     set myPrinter to Print_X(mnew)
  68.     myPrinter(mSetHeaderTop1, 40)
  69.     set header1 to "The Laughing Bird Restaurant"
  70.     myPrinter(mSetHeaderTop2, 700)
  71.     set header2 to "Page 1"
  72.     myPrinter(mSetJustify1, 0)
  73.     myPrinter(mSetJustify2, 0)
  74.     myPrinter(mSetHeaderStyle1, "Times New Roman", 18, 1)
  75.     myPrinter(mSetHeaderStyle2, "Times New Roman", 12, 1)
  76.     myPrinter(mSetBodyTop, 80)
  77.     set ErrMessage to myPrinter(mPrintPage, header1, header2, the text of field "Printfield", EMPTY, 0)
  78.     if objectp(myPrinter) then
  79.       myPrinter(mdispose)
  80.     end if
  81.     if string(ErrMessage) <> EMPTY then
  82.       put string(ErrMessage)
  83.     end if
  84.   else
  85.     set aName to CallBackTracer(mnew)
  86.     setCallBack(#PrintDoc, aName)
  87.     set PageHeader to "The Laughing Bird Restaurant"
  88.     set container to the text of cast "Printfield"
  89.     set PrintDialogString to "Laughing Bird Recipes"
  90.     set FontName to "hobo"
  91.     set FontSize to "12"
  92.     set BooleanSetUp to "true"
  93.     PrintDoc(PageHeader, container, PrintDialogString, FontName, FontSize, BooleanSetUp)
  94.   end if
  95. end
  96.  
  97. on printInfoNow
  98.   if the machineType = 256 then
  99.     set myPrinter to Print_X(mnew)
  100.     myPrinter(mSetHeaderTop1, 40)
  101.     set header1 to "Laughing Bird Password Registration"
  102.     myPrinter(mSetHeaderTop2, 700)
  103.     set header2 to "Thank You."
  104.     myPrinter(mSetJustify1, 0)
  105.     myPrinter(mSetJustify2, 0)
  106.     myPrinter(mSetHeaderStyle1, "Times New Roman", 18, 1)
  107.     myPrinter(mSetHeaderStyle2, "Times New Roman", 12, 1)
  108.     myPrinter(mSetBodyTop, 80)
  109.     set ErrMessage to myPrinter(mPrintPage, header1, header2, the text of field "Fullinfo2", EMPTY, 0)
  110.     if objectp(myPrinter) then
  111.       myPrinter(mdispose)
  112.     end if
  113.     if string(ErrMessage) <> EMPTY then
  114.       put string(ErrMessage)
  115.     end if
  116.   else
  117.     set aName to CallBackTracer(mnew)
  118.     setCallBack(#PrintDoc, aName)
  119.     set PageHeader to "Laughing Bird Password Registration"
  120.     set container to the text of cast "Fullinfo2"
  121.     set PrintDialogString to "Laughing Bird Recipes"
  122.     set FontName to "geneva"
  123.     set FontSize to "12"
  124.     set BooleanSetUp to "true"
  125.     PrintDoc(PageHeader, container, PrintDialogString, FontName, FontSize, BooleanSetUp)
  126.   end if
  127. end
  128.  
  129. on findAndReplaceAll sourceText, findText, replaceText
  130.   set findLength to length(findText) - 1
  131.   set startSearchAt to 1
  132.   repeat while sourceText contains findText
  133.     repeat with charNum = startSearchAt to length(sourceText) - findLength
  134.       set testChunk to char charNum to charNum + findLength of sourceText
  135.       if testChunk = findText then
  136.         if charNum = 1 then
  137.           set beforeChunk to EMPTY
  138.         else
  139.           set beforeChunk to char 1 to charNum - 1 of sourceText
  140.         end if
  141.         set afterChunk to char findLength + charNum + 1 to length(sourceText) of sourceText
  142.         set sourceText to beforeChunk & replaceText & afterChunk
  143.         set startSearchAt to charNum
  144.         exit repeat
  145.       end if
  146.     end repeat
  147.   end repeat
  148.   return sourceText
  149.   updateStage()
  150. end
  151.  
  152. factory CallBackTracer
  153. method mnew
  154.  
  155. method mSendHCMessage x
  156.  
  157. method mSendCardMessage x
  158.